
#pragma once
#include "Definitions.h"

#include "Error.h"

namespace ttgLib
{
	//Represents Fatal error: something global is broken and application should be terminated.
	class FatalError :public Error
	{
		public:
			//Creates error with required description only.
			inline FatalError(const char *description)
				:Error("Fatal error", NULL, description, NULL)
			{ /*nothing*/ }
			//Creates error with required description and error trace.
			inline FatalError(const char *description, Error &innerError)
				:Error("Fatal error", NULL, description, &innerError)
			{ /*nothing*/ }
			//Creates error with required description and position.
			inline FatalError(const char *description, const char *position)
				:Error("Fatal error", position, description, NULL)
			{ /*nothing*/ }
			//Creates error with required description, position and error trace.
			inline FatalError(const char *description, const char *position, Error &innerError)
				:Error("Fatal error", position, description, &innerError)
			{ /*nothing*/ }
			//Creates error with required description and detailed position.
			inline FatalError(const char *description,
						      const char *className,
							  const char *methodName)
				:Error("Fatal error", Error::FormatErrorPosition(className, methodName).c_str(), description, NULL)
			{ /*nothing*/ }
			//Creates error with required description and detailed position.
			inline FatalError(const char *description,
						      const char *className,
							  const char *methodName,
							  Error &innerError)
				:Error("Fatal error", Error::FormatErrorPosition(className, methodName).c_str(), description, &innerError)
			{ /*nothing*/ }
	};
}
